home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14928 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  941 b 

  1. Path: prodigy.com!usenet
  2. From: GQXN85A@prodigy.com (Richard Orlando)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: help with a simple c routine
  5. Date: 16 Apr 1996 03:18:06 GMT
  6. Organization: Prodigy Services Company  1-800-PRODIGY
  7. Distribution: world
  8. Message-ID: <4kv3he$14f4@usenetp1.news.prodigy.com>
  9. References: <4kin72$ns5@pelican.cs.ucla.edu> <4kjqcu$794@pelican.cs.ucla.edu>
  10. NNTP-Posting-Host: innugap3-int.news.prodigy.com
  11. X-Newsreader: Version 1.2
  12.  
  13. >
  14. >Hi all
  15. >
  16. >I am trying to write a simple c routine that gets rid of all the .. or . 
  17.  
  18. >in dir paths like somehting/../..  or somedir/./something type
  19. >
  20. >so let's say I ahve the follwoing paths
  21. >
  22. >/home/jlz/../jlz
  23. >
  24. >after parsing it I should have
  25. >
  26. >/home/jlz
  27. >
  28. >or
  29. >
  30. >/home/./jlz
  31. >
  32. >it becomes
  33. >
  34. >/home/jlz
  35. >
  36. >I can't think of an easy way of doing this.  Please help!
  37. >
  38. >thanks very much
  39.  
  40. Look in the strings.h header file.  There are string functions that will 
  41. help you pull out the "..".
  42.  
  43.